package com.wms.ymcc.web.controller;

import com.wms.ymcc.result.JSONResult;
import com.wms.ymcc.service.ITokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 阿盛哟
 * @description : 购买时获取token
 * @createDate : 2025/6/21 20:39
 */
@RestController
//@RequestMapping("/common")
public class TokenController {

    @Autowired
    private ITokenService tokenService;

    @GetMapping("/createToken/{id}")
    public JSONResult createToken(@PathVariable("id") Long id){
        String token = tokenService.createToken(id);
        return JSONResult.success(token);
    }
}